﻿#if($msg)
<script>
alert('$!msg');
</script>
#end
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>网站设置</title>
<link href="/include/manage/images/main/style.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/dialog/asyncbox.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.textInput {
	width:180px;
	height:18px;
}
</style>
<script language="javascript" src="/include/manage/js/jquery.js"></script>
<script type="text/javascript" src="/include/manage/js/AsyncBox.js"></script>
<script language="javascript">
jQuery.ajaxSetup ({
	cache: false
});

$(function(){
	$('#gensite').click(function(){
		/*asyncbox.open({
			title : '生成站点',
			url : '/include/manage/generate_site.jsp?sid=$!site.id',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '生成站点静态文件',
				content : '注意：仅当使用网站静态化时，此功能才有效，生成过程中请不要关闭窗口'
				},
		　　btnsbar : jQuery.btn.OK,
		　　callback : function(action,iframe){
		　　　}
		});*/
		if(confirm("生成网站将会耗费大量的系统资源和时间，系统会将此任务调整到后台执行，您可以在后台右上角看到执行进度，确定执行吗？")){
			window.parent.parent.loadTask("gensite","$!site.id",1);
			//jQuery('#taskbar').load('/include/system/status.jsp?sid=$!site.id');
		}
	});
	
	$('#genindex').click(function(){
		asyncbox.open({
			title : '生成首页',
			url : '/include/manage/generate_index.jsp?sid=$!site.id',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '生成站点首页文件',
				content : '注意：仅当使用网站静态化时，此功能才有效，生成过程中请不要关闭窗口'
				},
		　　btnsbar : jQuery.btn.OK,
		　　callback : function(action,iframe){
		　　　}
		});
	});
	
	$('#chooseTheme').click(function(){
		asyncbox.open({
			title : '选择主题',
			url : '/manage_theme_ajax.ad',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '选择当前站点主题',
				content : '选择当前站点所对应的主题css,系统会替换当前css'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　if(action == 'ok'){
					var s='';
					var str='';
					$("input[name='sel_user']:checked",iframe.document.body).each(function(){
						s=$(this).next().text();
						str=$(this).val();
					});
					$("#theme").val(str);
					$("#themeName")[0].innerHTML=s;
		　　}
		　　　}
		});
	});
});

function applyThisTheme(){
	if(confirm("确实要应用主题吗？")){
		$('#applyTheme')[0].disabled=true;
		jQuery.get('/manage_theme_ajax.ad?parameter=apply&id=$!site.theme&sid=$!site.id',function(data){
				$('#applyTheme')[0].disabled=false;
			});
	}
}

function hideHtmlConfig(){
	$('.html_config').hide();
}

function showHtmlConfig(){
	$('.html_config').show();
}
</script>
</head>
<body>
<form name="writeform" method="post" action="/manage_site.ad">
	<input type="hidden" name="parameter" value="$!action" />
	<input type="hidden" name="id" value="$!site.id" />
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td height="30" background="/include/manage/images/main/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="12" height="30"><img src="/include/manage/images/main/tab_03.gif" width="12" height="30" /></td>
						<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5%"><div align="center"><img src="/include/manage/images/main/tb.gif" width="16" height="16" /></div></td>
												<td width="95%"><span class="STYLE3">当前位置</span>：[内容管理]-[站点设置]</td>
											</tr>
										</table></td>
									<td width="54%"></td>
								</tr>
							</table></td>
						<td width="16"><img src="/include/manage/images/main/tab_07.gif" width="16" height="30" /></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="8" background="/include/manage/images/main/tab_12.gif">&nbsp;</td>
						<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6">
								<tr>
									<td width="100" height="25" bgcolor="#ffffff">&nbsp;网站名称<font color="red">*</font>：</td>
									<td width="*" bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="name" type="text" value="$!site.name" /></td>
									<td width="150" bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;网站域名<font color="red">*</font>：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="domain" type="text" value="$!site.domain" /></td>
									<td bgcolor="#ffffff"></td>
								</tr>
                                <tr>
									<td height="25" bgcolor="#ffffff">&nbsp;主题文件：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="css_file" type="text" value="$!site.css_file" /></td>
									<td bgcolor="#ffffff">样式文件，用于主题切换，默认为x.css，必须放置在站点的skin/css/下</td>
								</tr>
                                <tr>
									<td height="25" bgcolor="#ffffff">&nbsp;网站主题：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input id="theme" name="theme" type="hidden" value="$!site.theme" />
                                        <span id="themeName">$!site.getThemeName()</span>
                                        <input type="button" id="chooseTheme" value="选择主题" />
                                    <input type="button" id="applyTheme" name="applyTheme" value="应用主题" onClick="applyThisTheme()" />
                                    </td>
									<td bgcolor="#ffffff">
                                    </td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;网站语言：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="lang" type="text" value="$!site.lang" /></td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;是否静态化：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="html" id="isnothtml" type="radio" value="0" #if($site.html==0) checked#end onclick="hideHtmlConfig()" />
										<label for="isnothtml">不静态</label>
										&nbsp;
										<input name="html" id="ishtml" type="radio" value="1" #if($site.html==1) checked#end onclick="showHtmlConfig()" />
										<label for="ishtml">静态化</label>
									</td>
									<td bgcolor="#ffffff">#if($site.html==1)<input id="gensite" type="button" value="生成网站" />#end</td>
								</tr>
								<tr class="html_config" #if($site.html==0)style="display:none"#end>
									<td height="25" bgcolor="#ffffff">&nbsp;命名规则：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="html_rule" id="rule_cn" type="radio" value="0" #if($site.html_rule==0) checked#end />
										<label for="rule_cn">中文命名</label>
										&nbsp;
										<input name="html_rule" id="rule_en" type="radio" value="2" #if($site.html_rule==2) checked#end />
										<label for="rule_en">英文/拼音命名</label>
										&nbsp;
										<input name="html_rule" id="rule_num" type="radio" value="1" #if($site.html_rule==1) checked#end />
										<label for="rule_num">传统ID命名</label></td>
									<td bgcolor="#ffffff">仅当选择静态化时有效</td>
								</tr>
								<tr class="html_config" #if($site.html==0)style="display:none"#end>
									<td height="25" bgcolor="#ffffff">&nbsp;目录深度：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="html_dir" id="dir_year" type="radio" value="0" #if($site.html_dir==0) checked#end />
										<label for="dir_year">按年分</label>
										&nbsp;
										<input name="html_dir" id="dir_month" type="radio" value="1" #if($site.html_dir==1) checked#end />
										<label for="dir_month">按年月分</label>
										&nbsp;
										<input name="html_dir" id="dir_day" type="radio" value="2" #if($site.html_dir==2) checked#end />
										<label for="dir_day">按年月日分</label></td>
									<td bgcolor="#ffffff">仅当选择静态化时有效</td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;生成繁体：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="big5" id="isnotbig5" type="radio" value="0" #if($site.big5==0) checked#end />
										<label for="isnotbig5">不生成</label>
										&nbsp;
										<input name="big5" id="isbig5" type="radio" value="1" #if($site.big5==1) checked#end />
										<label for="isbig5">生成繁体</label></td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;模板目录<font color="red">*</font>：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="template" type="text" value="$!site.template" /></td>
									<td bgcolor="#ffffff"></td>
								</tr>
                                <tr>
									<td height="25" bgcolor="#ffffff">&nbsp;首页文件<font color="red">*</font>：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="index" type="text"#if($site.index) value="$!site.index"#else value="index.htm"#end /></td>
									<td bgcolor="#ffffff">#if($site.html==1)<input id="genindex" type="button" value="生成首页" />#end</td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;生成目录<font color="red">*</font>：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="pub_dir" type="text" value="$!site.pub_dir" /></td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;邮件服务器：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="mailserver" type="text" value="$!site.mailserver" /></td>
									<td bgcolor="#ffffff">例如:smtp.163.com</td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;邮件账号：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="mailuser" type="text" value="$!site.mailuser" /></td>
									<td bgcolor="#ffffff">例如:zergskj@163.com</td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;邮件密码：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input class="textInput" name="mailpass" type="password" value="$!site.mailpass" /></td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;生成缩略图：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="isthumb" id="isnotthumb" type="radio" value="0" #if($site.isthumb==0) checked#end />
										<label for="isnotthumb">不生成</label>
										&nbsp;
										<input name="isthumb" id="isthumb" type="radio" value="1" #if($site.isthumb==1) checked#end />
										<label for="isthumb">生成</label>
									</td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;评论审核：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="commcheck" id="notcommcheck" type="radio" value="0" #if($site.commcheck==0) checked #end/>
										<label for="notcommcheck">不审核</label>
										&nbsp;
										<input name="commcheck" id="commcheck" type="radio" value="1" #if($site.commcheck==1) checked #end/>
										<label for="commcheck">审核</label>
									</td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;自动转换成流媒体：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="isconvert_streammedia" id="isnotconvert_streammedia" type="radio" value="0" #if($site.isconvert_streammedia==0) checked #end/>
										<label for="isnotconvert_streammedia">否</label>
										&nbsp;
										<input name="isconvert_streammedia" id="isconvert_streammedia" type="radio" value="1" #if($site.isconvert_streammedia==1) checked #end/>
										<label for="isconvert_streammedia">是</label>
									</td>
									<td bgcolor="#ffffff"></td>
								</tr>
								<tr>
									<td height="25" bgcolor="#ffffff">&nbsp;自动转换为文库：</td>
									<td bgcolor="#ffffff">&nbsp;
										<input name="isconvert_library" id="isnotconvert_library" type="radio" value="0" #if($site.isconvert_library==0) checked #end/>
										<label for="isnotconvert_library">否</label>
										&nbsp;
										<input name="isconvert_library" id="isconvert_library" type="radio" value="1" #if($site.isconvert_library==1) checked #end/>
										<label for="isconvert_library">是</label>
									</td>
									<td bgcolor="#ffffff"></td>
								</tr>
							</table></td>
						<td width="8" background="/include/manage/images/main/tab_15.gif">&nbsp;</td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td height="35" background="/include/manage/images/main/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="12" height="35"><img src="/include/manage/images/main/tab_18.gif" width="12" height="35" /></td>
						<td valign="top"><div align="center">
								<input type="submit" name="Submit" value="保存" />
								&nbsp; &nbsp;
								<input type="reset" name="Reset" value="重写" />
								&nbsp; &nbsp;
								#if($action=="update")
								<input type="button" id="Review" name="Review" value="预览" onClick="window.open('/index.do?parameter=preview&sid=$!site.id')" />
								#end
							</div></td>
						<td width="16"><img src="/include/manage/images/main/tab_20.gif" width="16" height="35" /></td>
					</tr>
				</table></td>
		</tr>
	</table>
</form>
</body>
</html>